<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
      <el-form-item label="出险单号" prop="applyNo">
        <el-input v-model="queryParams.applyNo" placeholder="请输入出险单号" clearable size="small"
          @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="车牌号" prop="carPlateNo">
        <el-input v-model="queryParams.carPlateNo" placeholder="请输入车牌号" clearable size="small"
          @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
          v-hasPermi="['maintenance:outInsurance:add']">新增</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button type="info" plain icon="el-icon-upload2" size="mini" @click="handleImport"
          v-hasPermi="['maintenance:outInsurance:import']">导入</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button type="warning" plain icon="el-icon-download" size="mini" :loading="exportLoading"
          @click="handleExport" v-hasPermi="['maintenance:outInsurance:export']">导出</el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table v-loading="loading" :data="outInsuranceList" @selection-change="handleSelectionChange">
      <el-table-column label="车辆出险编号" align="center" prop="applyNo" />
      <el-table-column label="车牌号" align="center" prop="carPlateNo" />
      <el-table-column label="车架号" align="center" prop="vinNo" />
      <el-table-column label="车辆状态" align="center" prop="carStatus">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.car_status" :value="scope.row.carStatus" />
        </template>
      </el-table-column>
      <el-table-column label="出险时间" align="center" prop="outDate" width="180"/>
      <el-table-column label="出险地点" align="center" prop="outAddr" />
      <el-table-column label="事故等级" align="center" prop="outLevel">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.accident_level" :value="scope.row.outLevel" />
        </template>
      </el-table-column>
      <!-- <el-table-column label="出险总次数" align="center" prop="outNum" /> -->
      <el-table-column label="接收时间" align="center" prop="receiveDate" width="180"/>
      <el-table-column label="报案人" align="center" prop="reporter" />
      <el-table-column label="记录人" align="center" prop="operator" />
      <el-table-column label="操作" align="center" width="220" class-name="small-padding fixed-width" fixed="right">
        <template slot-scope="scope">
          <el-button size="mini" type="text"  @click="handleUpdate(scope.row)"
            v-hasPermi="['maintenance:outInsurance:edit']">修改</el-button>
          <el-button size="mini" type="text"  @click="handleDelete(scope.row)"
            v-hasPermi="['maintenance:outInsurance:remove']">删除</el-button>
            <el-button size="mini" type="text"  @click="handleDetails(scope.row)"
              v-hasPermi="['maintenance:outInsurance:query']">详情</el-button>
        </template>
      </el-table-column>
    </el-table>

    <pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
      @pagination="getList" />

    <!-- 添加或修改车辆出险对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="900px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="130px">
        <el-row :gutter="15">
          <el-col :span="12">
            <el-form-item label="车牌号" prop="carPlateNo">
              <!-- <el-input v-model="form.carPlateNo" placeholder="请输入车牌号" />-->
              <el-input v-model="form.carPlateNo" placeholder="请选择车辆" clearable :style="{width: '100%'}" :readonly="true">
                <el-button slot="append" icon="el-icon-search" @click="showCarBox=true"></el-button>
              </el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="出险时间" prop="outDate">
              <el-date-picker clearable size="small" v-model="form.outDate" type="datetime" format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
                placeholder="选择出险时间">
              </el-date-picker>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="15">
          <el-col :span="24">
            <el-form-item label="出险地点" prop="outAddr">
              <el-input v-model="form.outAddr" placeholder="请输入出险地点" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="15">
          <el-col :span="24">
            <el-form-item label="出险经过及原因" prop="outReason">
              <el-input v-model="form.outReason" type="textarea" placeholder="请输入出险经过及原因" :maxlength="100"
                show-word-limit :autosize="{minRows: 4, maxRows: 4}" :style="{width: '100%'}" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="15">
          <el-col :span="12">
            <el-form-item label="事故等级" prop="outLevel">
              <el-select v-model="form.outLevel" placeholder="请选择维修状态" clearable size="small">
                <el-option v-for="dict in dict.type.accident_level" :key="dict.value" :label="dict.label"
                  :value="Number(dict.value)" />
              </el-select>
            </el-form-item>
          </el-col>
          <!-- <el-col :span="12">
            <el-form-item label="出险总次数" prop="outNum">
              <el-input v-model="form.outNum" placeholder="请输入出险总次数" />
            </el-form-item>
          </el-col> -->
        </el-row>
        <el-row :gutter="15">
          <el-col :span="12">
            <el-form-item label="接收时间" prop="receiveDate">
              <el-date-picker clearable size="small" v-model="form.receiveDate" type="datetime" format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
                placeholder="选择接收时间">
              </el-date-picker>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="报案人" prop="reporter">
              <el-input v-model="form.reporter" placeholder="请输入报案人" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="15">
          <el-col :span="12">
            <el-form-item label="交强险赔付" prop="qxIsPay">
              <el-radio-group v-model="form.qxIsPay">
                <el-radio v-for="dict in dict.type.business_yes_no" :key="dict.value" :label="parseInt(dict.value)">
                  {{dict.label}}
                </el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="15" v-if="form.qxIsPay==1">

          <el-col :span="12">
            <el-form-item label="交强险赔付金额" prop="qxPayFee">
              <el-input v-model="form.qxPayFee" placeholder="请输入交强险赔付金额" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="交强险赔付时间" prop="qxPayDate">
              <el-date-picker clearable size="small" v-model="form.qxPayDate" type="datetime" format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
                placeholder="选择交强险赔付时间">
              </el-date-picker>
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="交强险保险公司" prop="qxInsuranceCompanyId">
              <el-select v-model="form.qxInsuranceCompanyId" style="width:250px" @change="jqCompany">
                  <template v-for="item in syList">
                      <el-option :label="item.companyName" :value="item.companyNo" :key="item.companyNo"></el-option>
                  </template>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="15">
          <el-col :span="12">
            <el-form-item label="商业险赔付" prop="sxIsPay">
              <el-radio-group v-model="form.sxIsPay">
                <el-radio v-for="dict in dict.type.business_yes_no" :key="dict.value" :label="parseInt(dict.value)">
                  {{dict.label}}
                </el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="15" v-if="form.sxIsPay==1">
          <el-col :span="12">
            <el-form-item label="商业险赔付金额" prop="sxPayFee">
              <el-input v-model="form.sxPayFee" placeholder="请输入商业险赔付金额" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="商业险赔付时间" prop="sxPayDate">
              <el-date-picker clearable size="small" v-model="form.sxPayDate" type="datetime" format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
                placeholder="选择商业险赔付时间">
              </el-date-picker>
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="商业险保险公司" prop="sxInsuranceCompanyId">
              <el-select v-model="form.sxInsuranceCompanyId" style="width:250px" @change="syCompany">
                  <template v-for="item in syList">
                      <el-option :label="item.companyName" :value="item.companyNo" :key="item.companyNo"></el-option>
                  </template>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="15">
          <el-col :span="24">
            <el-form-item label="备注" prop="remark">
              <el-input v-model="form.remark" type="textarea" placeholder="请输入备注" :maxlength="100" show-word-limit
                :autosize="{minRows: 4, maxRows: 4}" :style="{width: '100%'}" />
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm"  :loading="submitBtnLoading">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>

<!-- 详情对话框 -->
    <el-dialog title="出险记录详情" :visible.sync="detailsOpen" width="900px" append-to-body>
      <MmvTitle title="出险车辆"></MmvTitle>
      <el-form label-width="120px">
        <el-row :gutter="15">
          <el-col :span="12">
            <el-form-item label="出险单号:">{{form.applyNo}}</el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="车牌号:">{{form.carPlateNo}}</el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="车架号:">{{form.vinNo}}</el-form-item>
          </el-col>
        </el-row>
        </el-form>
        <MmvTitle title="出险信息"></MmvTitle>
        <el-form label-width="120px">
        <el-row :gutter="15">
          <el-col :span="12">
            <el-form-item label="出险时间:" >{{form.outDate}}</el-form-item>
           </el-col>
          <el-col :span="24">
            <el-form-item label="出险地点:" >{{form.outAddr}}</el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="15">
          <el-col :span="24">
            <el-form-item label="出险经过及原因:" prop="outReason">
              <el-input v-model="form.outReason" type="textarea" placeholder="请输入出险经过及原因" :maxlength="100"
                show-word-limit :autosize="{minRows: 4, maxRows: 4}" :style="{width: '100%'}" :readonly="true"/>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="15">
          <el-col :span="12">
            <el-form-item label="事故等级:" prop="outLevel">
              <el-select v-model="form.outLevel" placeholder="请选择维修状态" clearable size="small" :disabled="true">
                <el-option v-for="dict in dict.type.accident_level" :key="dict.value" :label="dict.label"
                  :value="parseInt(dict.value)" />
              </el-select>
            </el-form-item>
          </el-col>
          <!-- <el-col :span="12">
            <el-form-item label="出险总次数:"  >{{form.outNum}}</el-form-item>
          </el-col> -->
        </el-row>
        <el-row :gutter="15">
          <el-col :span="12">
            <el-form-item label="接收时间:"  >{{form.receiveDate}}</el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="报案人:"  >{{form.reporter}}</el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="15">
          <el-col :span="12">
            <el-form-item label="交强险赔付:" prop="qxIsPay">
              <el-radio-group v-model="form.qxIsPay">
                <el-radio v-for="dict in dict.type.business_yes_no" :key="dict.value" :label="parseInt(dict.value)" :disabled="true">
                  {{dict.label}}
                </el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="15" v-if="form.qxIsPay==1">

          <el-col :span="12">
            <el-form-item label="交强险赔付金额:" >{{form.qxPayFee}}</el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="交强险赔付时间:" >{{form.qxPayDate}}</el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="交强险保险公司:" >
              <!-- {{form.qxInsuranceCompany}} -->
              {{
                syList.find(val=>val.companyNo==form.qxInsuranceCompanyId)?syList.find(val=>val.companyNo==form.qxInsuranceCompanyId).companyName:''
              }}
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="15">
          <el-col :span="12">
            <el-form-item label="商业险赔付:" prop="sxIsPay">
              <el-radio-group v-model="form.sxIsPay">
                <el-radio v-for="dict in dict.type.business_yes_no" :key="dict.value" :label="parseInt(dict.value)" :disabled="true">
                  {{dict.label}}
                </el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="15" v-if="form.sxIsPay==1">
          <el-col :span="12">
            <el-form-item label="商业险赔付金额:" >{{form.sxPayFee}}</el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="商业险赔付时间:"  >{{form.sxPayDate}}</el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="商业险保险公司:" >
              <!-- {{form.sxInsuranceCompany}} -->
              {{
                syList.find(val=>val.companyNo==form.sxInsuranceCompanyId)?syList.find(val=>val.companyNo==form.sxInsuranceCompanyId).companyName:''
              }}
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="15">
          <el-col :span="24">
            <el-form-item label="备注:" prop="remark">
              <el-input v-model="form.remark" type="textarea" placeholder="请输入备注" :maxlength="100" show-word-limit :disabled="true"
                :autosize="{minRows: 4, maxRows: 4}" :style="{width: '100%'}" />
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
    </el-dialog>
    <!-- 导入对话框 -->
    <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
      <el-upload ref="upload" :limit="1" accept=".xlsx, .xls" :headers="upload.headers"
        :action="upload.url + '?updateSupport=' + upload.updateSupport" :disabled="upload.isUploading"
        :on-progress="handleFileUploadProgress" :on-success="handleFileSuccess" :auto-upload="false" drag>
        <i class="el-icon-upload"></i>
        <div class="el-upload__text">将文件拖到此处，或<em>点击上传</em></div>
        <div class="el-upload__tip text-center" slot="tip">
          <!-- <div class="el-upload__tip" slot="tip">
            <el-checkbox v-model="upload.updateSupport" /> 是否更新已经存在的用户数据
          </div> -->
          <span>仅允许导入xls、xlsx格式文件。</span>
          <el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;"
            @click="importTemplate">下载模板</el-link>
        </div>
      </el-upload>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitFileForm">确 定</el-button>
        <el-button @click="upload.open = false">取 消</el-button>
      </div>
    </el-dialog>

    <select-car v-model="showCarBox" @success="selectCarInfo"></select-car>
  </div>
</template>

<script>
  import { insuranceCompanyList } from "@/api/maintenance/insurance";
import {
addOutInsurance, delOutInsurance, exportOutInsurance, getOutInsurance, importTemplate, listOutInsurance, updateOutInsurance
} from "@/api/maintenance/outInsurance";
import MmvTitle from '@/components/MmvUI/MmvTitle.vue';
import {
getToken
} from "@/utils/auth";
import selectCar from "../../components/selectCar.vue";

  export default {
    name: "OutInsurance",
    dicts: ['car_status', 'accident_level', 'business_yes_no'],
    components: {
        MmvTitle,
        selectCar
    },
    data() {
      return {
        submitBtnLoading: false,
        showCarBox:false,
        // 遮罩层
        loading: true,
        // 导出遮罩层
        exportLoading: false,
        // 选中数组
        ids: [],
        // 非单个禁用
        single: true,
        // 非多个禁用
        multiple: true,
        // 显示搜索条件
        showSearch: true,
        // 总条数
        total: 0,
        // 车辆出险表格数据
        outInsuranceList: [],
        // 弹出层标题
        title: "",
        // 是否显示弹出层
        open: false,

        detailsOpen: false,
        // 查询参数
        queryParams: {
          pageNum: 1,
          pageSize: 10,
          applyNo: null,
          carPlateNo: null,
        },
        // 用户导入参数
        upload: {
          // 是否显示弹出层
          open: false,
          // 弹出层标题
          title: "",
          // 是否禁用上传
          isUploading: false,
          // 是否更新已经存在的用户数据
          updateSupport: 0,
          // 设置上传的请求头部
          headers: {
            Authorization: "Bearer " + getToken()
          },
          // 上传的地址
          url: process.env.VUE_APP_BASE_API + "/maintenance/outInsurance/import"
        },
        // 表单参数
        form: {
          qxIsPay: 2,
          sxIsPay: 2
        },
        // 表单校验
        rules: {
          carPlateNo: [{
            required: true,
            message: '车牌号不能为空',
            trigger: 'change'
          }],
          outDate: [{
            required: true,
            message: '出险时间不能为空',
            trigger: 'change'
          }],
          outAddr: [{
            required: true,
            message: '出险地点不能为空',
            trigger: 'change'
          }],
          outLevel: [{
            required: true,
            message: '事故等级不能为空',
            trigger: 'change'
          }],
          outNum: [{
            required: true,
            message: '出险总次数不能为空',
            trigger: 'change'
          }],
          receiveDate: [{
            required: true,
            message: '接收时间不能为空',
            trigger: 'change'
          }],
          reporter: [{
            required: true,
            message: '报案人不能为空',
            trigger: 'change'
          }],
          qxPayFee: [{
            required: true,
            message: '交强险赔付金额不能为空',
            trigger: 'change'
          },{
					  pattern: /^[0-9]+(.[0-9]{1,2})?$/,
					  message: '价值为正数，且保留两位小数',
					  trigger: 'blur',
					}],
          qxPayDate: [{
            required: true,
            message: '交强险赔付时间不能为空',
            trigger: 'change'
          }],
          qxInsuranceCompanyId: [{
            required: true,
            message: '交强险保险公司不能为空',
            trigger: 'change'
          }],
          sxPayFee: [{
            required: true,
            message: '商业险赔付金额不能为空',
            trigger: 'change'
          },{
					  pattern: /^[0-9]+(.[0-9]{1,2})?$/,
					  message: '价值为正数，且保留两位小数',
					  trigger: 'blur',
					}],
          sxPayDate: [{
            required: true,
            message: '商业险赔付时间不能为空',
            trigger: 'change'
          }],
          sxInsuranceCompanyId: [{
            required: true,
            message: '商业险保险公司不能为空',
            trigger: 'change'
          }],
        }
      };
    },
    created() {
      this.getList();
      this.syxList()
      this.jqxList()
    },
    methods: {
      /** 查询车辆出险列表 */
      getList() {
        this.loading = true;
        listOutInsurance(this.queryParams).then(response => {
          this.outInsuranceList = response.rows;
          this.total = response.total;
          this.loading = false;
        });
      },
      // 取消按钮
      cancel() {
        this.open = false;
        this.reset();
      },
      // 表单重置
      reset() {
        this.form = {
          id: null,
          applyNo: null,
          carId: null,
          carPlateNo: null,
          vinNo: null,
          carStatus: 0,
          outDate: null,
          outAddr: null,
          outReason: null,
          outLevel: null,
          responsibleParty: null,
          outNum: null,
          deptId: null,
          delFlag: null,
          receiveDate: null,
          reporter: null,
          qxInsuranceCompanyId: null,
          qxIsPay: 2,
          qxPayFee: null,
          qxPayDate: null,
          sxIsPay: 2,
          sxPayFee: null,
          sxInsuranceCompanyId: null,
          sxPayDate: null,
          operator: null,
          remark: null,
          createBy: null,
          createTime: null,
          updateBy: null,
          updateTime: null,
          tenantId: null
        };
        this.resetForm("form");
      },
      /** 搜索按钮操作 */
      handleQuery() {
        this.queryParams.pageNum = 1;
        this.getList();
      },
      selectCarInfo(car){
        this.showCarBox=false;
        if(car){
          this.form.carId=car.carId;
          this.form.carPlateNo=car.carNo;
        }
      },
      /** 重置按钮操作 */
      resetQuery() {
        this.resetForm("queryForm");
        this.handleQuery();
      },
      // 多选框选中数据
      handleSelectionChange(selection) {
        this.ids = selection.map(item => item.id)
        this.single = selection.length !== 1
        this.multiple = !selection.length
      },
      /** 新增按钮操作 */
      handleAdd() {
        this.reset();
        this.open = true;
        this.title = "添加车辆出险";
      },
      //商业险
      syxList() {
          insuranceCompanyList(2).then(response => {
              this.syList = response.data;
          })
      },
      //交强险
      jqxList() {
          insuranceCompanyList(1).then(response => {
              this.jqList = response.data;
          })
      },
      syCompany(val) {
          this.form.sycompulsoryCompanyId = val
          this.syList.map(item => {
              if (val == item.companyNo) {
                  this.form.sycompulsoryCompany = item.companyName
              }
          })
      },
      jqCompany(val) {
          this.form.jqcompulsoryCompanyId = val
          this.syList.map(item => {
              if (val == item.companyNo) {
                  this.form.jqcompulsoryCompany = item.companyName
              }
          })
      },
      /** 修改按钮操作 */
      handleUpdate(row) {
        this.reset();
        const id = row.id || this.ids
        getOutInsurance(id).then(response => {
          this.form = response.data;
          this.open = true;
          this.title = "修改车辆出险";
        });
      },
      /** 详情按钮操作 */
      handleDetails(row) {
        this.reset();
        const id = row.id || this.ids
        getOutInsurance(id).then(response => {
          this.form = response.data;
          this.detailsOpen = true;
        });
      },
      /** 提交按钮 */
      submitForm() {
        this.submitBtnLoading = true;
        this.$refs["form"].validate(valid => {
          if (valid) {
            try {

            if (this.form.id != null) {
              updateOutInsurance(this.form).then(response => {
                this.$modal.msgSuccess("修改成功");
                this.open = false;
                this.getList();
                // this.submitBtnLoading = false
              });
            } else {
              addOutInsurance(this.form).then(response => {
                this.$modal.msgSuccess("新增成功");
                this.open = false;
                this.getList();
                // this.submitBtnLoading = false
              });
            }
                        } catch (error) {
                          console.log(error);
              this.submitBtnLoading = false
            }
          }
        });
        setTimeout(()=>{
          this.submitBtnLoading = false;
        },2e3);
      },
      /** 删除按钮操作 */
      handleDelete(row) {
        const ids = row.id //|| this.ids;
        this.$modal.confirm('是否确认删除车辆出险数据项？').then(function() {
          return delOutInsurance(ids);
        }).then(() => {
          this.getList();
          this.$modal.msgSuccess("删除成功");
        }).catch(() => {});
      },
      /** 导入按钮操作 */
      handleImport() {
        this.upload.title = "出险单导入";
        this.upload.open = true;
      },
      /** 下载模板操作 */
      importTemplate() {
        importTemplate().then(response => {
          this.$download.name(response.msg);
        });
      },
      // 文件上传中处理
      handleFileUploadProgress(event, file, fileList) {
        this.upload.isUploading = true;
      },
      // 文件上传成功处理
      handleFileSuccess(response, file, fileList) {
        this.upload.open = false;
        this.upload.isUploading = false;
        this.$refs.upload.clearFiles();
        this.$alert(response.msg, "导入结果", {
          dangerouslyUseHTMLString: true
        });
        this.getList();
      },
      // 提交上传文件
      submitFileForm() {
        this.$refs.upload.submit();
      },
      /** 导出按钮操作 */
      handleExport() {
        const queryParams = this.queryParams;
        this.$modal.confirm('是否确认导出所有车辆出险数据项？').then(() => {
          this.exportLoading = true;
          return exportOutInsurance(queryParams);
        }).then(response => {
          this.$download.name(response.msg);
          this.exportLoading = false;
        }).catch(() => {});
      }
    }
  };
</script>
<style scoped="scoped">
  /deep/ .el-date-editor.el-input,
  .el-date-editor.el-input__inner {
    width: 100% !important;
  }


  /deep/ .el-select {
    width: 100% !important;
  }
</style>
